package cn.huangsm.advance.optimisticlock.controller;

import cn.huangsm.advance.optimisticlock.bean.User;
import cn.huangsm.advance.optimisticlock.mapper.UserMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author huang
 * @PACKAGE_NAME cn.huangsm.advance.optimisticlock
 * @PROJECT_NAME advance-code
 * @date 2019/1/10
 */
@Service
public class UserService  extends ServiceImpl<UserMapper, User>  {

    @Autowired
    private UserMapper userMapper;
    public List<User> findPage(){
        IPage<User> userIPage = userMapper.selectPage(new Page<User>(1, 2), null);
        return userIPage.getRecords();
    }
}
